package com.ocean.controller.library;

import com.ocean.entity.library.Announcement;
import com.ocean.entity.library.Category;
import com.ocean.service.library.AnnouncementService;
import com.ocean.service.library.CategoryService;
import com.ocean.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * Project：SchoolManage
 * Package：com.ocean.controller.library
 * Author:zy
 * Time:2023/3/3
 */
@RestController
@RequestMapping("/api/library/category")
public class CategoryController {
    @Autowired
    private CategoryService categoryService;


    @PostMapping("save.do")
    public R save(@RequestBody Category category){
        return categoryService.save(category);
    }

    @RequestMapping("querypage.do")
    public R queryPage(int page, int size,String name,String detail){
        return categoryService.queryPage(page,size,name,detail);
    }

    @GetMapping("del.do")
    public R delete(int id){
        return categoryService.delete(id);
    }

    @PostMapping("update.do")
    public R update(@RequestBody Category category){

        return categoryService.update(category);
    }
}
